﻿using System;
using System.Net.Sockets;
using Net.Server;

namespace Net
{
    public class NetManagerBase:INetEventHandler
    {
        /// <summary>
        /// 是否使用心跳
        /// </summary>
        public bool IsUsingPing = false;
        /// <summary>
        /// 心跳检测时间间隔,单位秒
        /// </summary>
        public const long PingInterval = 30;

        public virtual void Close(Socket socket) { }

        public virtual void OnAccept(NetSession session)
        {
        }
        public virtual void OnConnectSucc(NetSession session)
        {
        }
        public virtual void OnConnectFailed(NetSession session, string reason, Exception e = null)
        {
        }
        public virtual void OnDisconnect(NetSession session)
        {
        }
        public virtual void OnReceivePacket(NetSession session, NetPacket packet)
        {
        }
    }
}